//
//  VisitorView.swift
//  WeiBoSwift
//
//  Created by 吴斌 on 2022/9/21.
//

import UIKit

class VisitorView: UIView {

    //MARK: - 提供快速通过xib创建的类方法
    class func visitorView() -> VisitorView {
        return Bundle.main.loadNibNamed("VisitorView", owner: nil, options: nil)?.first as! VisitorView
    }

    //MARK: - 控件的属性
    @IBOutlet weak var logoView: UIImageView!
    @IBOutlet weak var tipLabel: UILabel!
    @IBOutlet weak var rigisterBtn: UIButton!
    @IBOutlet weak var loginBtn: UIButton!
    
    
    
    //MARK: - 自定义函数
    func setupVisitorViewInfo(tipContent: String) {
        tipLabel.text = tipContent
    }
    
    //MARK: - logo动画
    func addRotationAnim() {
        //1.创建动画
        let rotationAnim = CABasicAnimation(keyPath: "transform.rotation.z")
        
        //2.设置动画的属性
        rotationAnim.fromValue = 0
        rotationAnim.toValue = Double.pi * 2
        rotationAnim.repeatCount = MAXFLOAT
        rotationAnim.duration = 5
        rotationAnim.isRemovedOnCompletion = false
        
        //3.将动画添加到layer中
        logoView.layer.add(rotationAnim, forKey: nil)
        
    }
}
